const express=require('express');
//const express_static=require('express-static');

var server=express();
server.listen(11111);



/*1 */
server.use(express.static(__dirname));  //+ '/website'
/*1 */

/*2 */
//用户数据
var  users={
    'yexuan':'0628',
    'jiayiwen':'1111'
};

server.use('/login',function(req,res){
    //console.log(req.query);
    var user=req.query['user'];
    var pass=req.query['pass'];
    console.log(user+'-->'+pass+'-->'+users[user]);

    if(users[user]==null){
        res.send({ok:false,msg:'此用户不存在！'});
    }else{
        if(users[user]!=pass){
        res.send({ok:false,msg:'密码错误！'});
        }else{
        res.send({ok:true,msg:'成功……'});
        }
    }
})
/*2 */